
<%-- 
    Document   : index
    Created on : 5/Jun/2009, 5:42:11
    Author     : eurico
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="deti.es.ukni.cm.account.AccountBean"%>
<%@page import="deti.es.ukni.persistence.entity.*" %>
<%@page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

 <%
    AccountBean curAccount = (AccountBean) session.getAttribute("account");
 %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../resource/myband.css" />
        <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA-IxVtEF80D4xYMtKixTl9xTwM0brOpm-All5BF6PoaKBxRWWERTJYYYTq_EhpUWmZOadEtkHw-UC6Q"></script>

        <title>MyBand</title>
    </head>
    <body>
                <div id="header">
            <div id="logo">
                <img src="../resource/mybandlogo.png" alt="myband_logo"/>
            </div>
        </div>

        <div id="nav">
            <% if ( curAccount == null ){ %>
            <ul>
                <li><a href="../account/login.jsp">Login</a></li>
                <li><a href="../account/new.jsp">Create account</a></li>
            </ul>
            <%}else{%>
            <a href="../account/logout.jsp">Logout</a>
            <ul>
                <li><a href="../account">Account</a></li>
                <li> <a href="../band">Friends</a></li>
                <li><a href="../account/favorite.jsp">Your favorite bands</a></li>
                <% if (curAccount.hasBand() ){ %>
                <li><a href="../band/new.jsp">My Band</a> </li>
                <% } %>
            </ul>
            <%}%>
        </div>
        <div id="content">
            <div class="bands">
                <h2>Find your new favorite band!</h2>
<% 
       List<Band> bands = AccountBean.findAllBands();

       int alt = 0;
       for( Band b: bands){ %>

                <div class="band <%= alt == 0 ? "":"alt"%>">
                    <a href="view/index.jsp?id=<%= b.getIdband() %>"> <%= b.getName() %> </a><br/>
                    <span class="followers">Has <%= b.getAccountCollection().size() %> follower(s)</span><br/>
                    <blockquote>
                        <%= "&#8220;" + b.getDescription() + "&#8221;" %>
                    </blockquote>
                </div>

       <%
            alt = 1 - alt;
       }%>
            </div>
        </div>
    </body>
</html>
